package com.study.dubbo.service.service.impl;


import com.alibaba.dubbo.config.annotation.Service;
import com.study.dubbo.service.dao.TestDao;
import com.study.dubbo.service.service.TestService;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author lin
 * @create 2018-07-30 16:40
 **/
//,mock = "com.study.dubbo.service.service.mock.TestServiceImplMock"
// -Ddubbo.protocol.port=20882
@Service(timeout = 6000)
@Slf4j
public class TestServiceImpl implements TestService {
    @Resource
    private TestDao testDao;
    @Override
    public String test() {
        log.info("被调用+"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return testDao.getTest();
    }
}
